﻿/*
	Funktionen und Prozeduren
	Schema: <SchemaName, sysname, finance>
	BusinessObject: <BusinessObjectName, sysname, BusinessObject>
	Version: <VersionNumber, nvarchar(128), 0.0.1.0>
*/

CREATE FUNCTION [<SchemaName, sysname, finance>].[fn_Exists<BusinessObjectName, sysname, BusinessObject>ByPK]
(
	@PK INT
)
RETURNS BIT
AS
BEGIN
	DECLARE @exists BIT =  0

	SELECT @exists = 1 FROM [<SchemaName, sysname, finance>].[<BusinessObjectName, sysname, BusinessObject>]
		WHERE [PK_<BusinessObjectName, sysname, BusinessObject>] = @PK

	SET @exists = ISNULL(@exists, 0)

	RETURN @exists
END
GO